package cn.rui;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.context.request.RequestContextListener;

@SpringBootApplication
@MapperScan("cn.rui.mapper")
@Slf4j
public class SecurityRemeberMeApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run (SecurityRemeberMeApplication.class, args);

        //SpringApplication springApplication = new SpringApplication(SecurityRemeberMeApplication.class);
        //springApplication.setBannerMode(Banner.Mode.OFF);
        log.info("--------------------------------------项目启动成功--------------------------------------");
    }

    //RequestContextListener监听器
    @Bean
    public RequestContextListener requestCont1extListener() {
        return new RequestContextListener();
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }
}
